#include <iostream>
using namespace std;

class Cat
{
public:
    Cat(string name, int age)
    {
        this->name = name;
        this->age = age;
    }

    friend ostream &operator<<(ostream &os, Cat &c1)
    {
        os << "name:" << c1.name << " age:" << c1.age << endl;
        return os;
    }

    friend istream &operator>>(istream &is, Cat &c1)
    {
        is >> c1.name >> c1.age;
        return is;
    }

private:
    string name;
    int age;
};

int main()
{
    Cat c1("Tom", 10);
    Cat c2("Jerry", 20);

    cin >> c1 >> c2;

    cout << c1 << c2;
    return 0;
}